<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">
    <body>
        <a4j:form>
            <rich:panel styleClass="login" style="">
                <f:facet name="header">
                    <h:outputText value="Digite o usuário e a senha"/>
                </f:facet>
                <h:panelGrid columns="2">
                    <h:outputText value="Login:"/><h:inputText value="#{MBusuario.usuario.login}" size="20" styleClass="camposLogin"/>
                    <h:outputText value="Senha:"/><h:inputSecret value="#{MBusuario.usuario.senha}" size="20" styleClass="camposLogin"/>
                </h:panelGrid>
                <a4j:commandButton action="#{MBusuario.efetuaLogin}" value="Entrar" reRender="mensagemErro"/>
            </rich:panel>
        </a4j:form>
        <a4j:status>
            <f:facet name="start">
                <h:outputText value="Login realizado com sucesso." />
            </f:facet>
        </a4j:status>
        <rich:panel id="mensagemErro" rendered="#{MBusuario.msgErro}" styleClass="msgErro">
            <h:panelGrid columns="2">
                <h:outputText value="Erro! Login ou senha inválidos." />
            </h:panelGrid>
        </rich:panel>
    </body>
</html>

